﻿
@{
    ViewBag.Title = "车辆统计";
}
<style type="text/css">
    html, body {
        height: 100%;
        margin: 0px;
        padding: 0px;
    }
</style>
<div id="main" style="width: 100%;height:100%;"></div>

<script src="~/Content/lib/echarts/echarts.min.js"></script>
<script>
    layui.use(['jquery'], function () {
        var $ = layui.jquery;
        var myChart = echarts.init($("#main")[0]);
        // 指定图表的配置项和数据
        var option = {
            title: {
                text: '车辆统计',
                left: 'left'
            },
            legend: {},
            tooltip: {},
            dataset: {
                source: [
                    ['车辆状态', '正常', '故障'],
                    ['园区一', 85, 43],
                    ['园区二', 83, 13],
                    ['园区三', 20, 23],
                    ['园区四', 60, 5]
                ]
            },
            xAxis: { type: 'category' },
            yAxis: {},
            series: [
                { type: 'bar' },
                { type: 'bar' }
            ],
            color:['green','red']
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    })
</script>